//
//  ViewController.m
//  lasstwo
//
//  Created by mac on 16-4-19.
//  Copyright (c) 2016年 hdf. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
{
    NSArray* data;
}

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    
    self.view.backgroundColor = [UIColor purpleColor];
    
    UITableView *tableview = [[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain ];
    
    tableview.dataSource = self;
    
    [self.view addSubview:tableview];
    data = @[
             @"黄锋大人。",
             @"陈姣小主。",
             @"彭响凤小仆。",
             @"伍银容嬷嬷。",
             @"李家小主。",
             @"郭家小主。"
             ];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // return 10;
    return data.count;
    
}

- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    UITableViewCell*call = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
    call.textLabel.text = data[indexPath.row];
    return call;
}



- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
